﻿using RayDen.Library.Components.Color.Types;
using RayDen.Library.Core.Primitives;
using RayDen.Library.Data;
using RayDen.RayEngine.Corrector.Managers;

namespace RayEngine.Spectral.Entities.Textures
{
    public sealed class ImageTexture :BaseTexture<RgbSpectrumTexture> 
    {
        public ImageTexture(int id, RgbSpectrumTexture val) : base(id, val)
        {
        }

        public override IColorType Evaluate(float u, float v)
        {
            return ColorManager.Instance.Convert(value.Sample(u, v));
        }

        public override IColorType Evaluate(ShadePointInfo point)
        {
            return ColorManager.Instance.Convert(value.Sample(point.U, point.V));
        }
    }
}